package sharedData;

/**
 * Abstract class passing basic functionality to an inheriting class.
 * 
 * @author Didzis Petkus, Danny Johansen, Liviu Berheci
 * 
 */
public abstract class ADataItem implements IDataItem {

	private final byte type;
	private final float x;
	private final float y;
	private final float heading;

	/**
	 * Constructor for abstract DataItem object
	 * @param dataType - byte data type
	 * @param x - float x coordinate
	 * @param y - float y coordinate
	 * @param heading - float heading angle
	 */
	public ADataItem(byte dataType, float x, float y, float heading) {
		this.type = dataType;
		this.x = x;
		this.y = y;
		this.heading = heading;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see sharedData.IDataItem#getType()
	 */
	@Override
	public byte getType() {
		return type;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see sharedData.IDataItem#getX()
	 */
	@Override
	public float getX() {
		return x;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see sharedData.IDataItem#getY()
	 */
	@Override
	public float getY() {
		return y;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see sharedData.IDataItem#getHeading()
	 */
	@Override
	public float getHeading() {
		return heading;
	}

}
